<?php
if(!$profile = $model->profile)
	$profile = new YumProfile;


$this->pageTitle = Yum::t('Profile');
$this->title = CHtml::activeLabel($model,'username');
$this->breadcrumbs = array(Yum::t('Profile'), $model->username);
Yum::renderFlash();
?>

<div id="profile">
	<div class="profile_avatar">
		<?php echo $model->getAvatar(); ?>
	</div>
	
	<div class="subscribe">
		<?php $this -> widget('widget.educator.wsubscribe',array('model'=>$model));?>
		
		<?php $this -> widget('widget.educator.wlike',array('model'=>$model));?>
	</div>
	
	<?php $this->renderPartial(Yum::module('profile')->publicFieldsView, array('profile' => $model->profile)); ?>
<br />


<h1>播放记录</h1>
<ul>
<?php foreach($history_model as $_m):?>
	<li>
		<a href="<?php echo $_m -> audios -> accessUrl ?>">
			<?php echo $_m -> audios -> audio_name;?>
		</a>
	</li>
<?php endforeach;?>
</ul>

<?php
if(Yum::hasModule('friendship') && 0)
$this->renderPartial('application.modules.friendship.views.friendship.friends', array('model' => $model)); ?>
<br />
<?php
if(@Yum::module('message')->messageSystem != 0) $this->renderPartial('/message/write_a_message', array('model' => $model)); ?>
<br />

<?php
if(Yum::module('profile')->enableProfileComments && Yii::app()->controller->action->id != 'update' && isset($model->profile))
	 $this->renderPartial(Yum::module('profile')->profileCommentIndexView, array('model' => $model->profile)); 
?>
</div>
<?php
 if(!Yii::app()->user->isGuest && Yii::app()->user->id == $model->id) {
	echo CHtml::link(Yum::t('Edit profile'), array('//profile/profile/update'));
	echo '&nbsp;';
	echo CHtml::link(Yum::t('Upload avatar image'), array('//avatar/avatar/editAvatar'));
}

